package Practice2;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.IOException;

public class Servlet1 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String username = request.getParameter("username");
        System.out.println("Servlet1 username: " + username);
        // 盖Servlet1的章
        request.setAttribute("key1","Servlet1的章");
        RequestDispatcher dispatcher2 = request.getRequestDispatcher("/Servlet2");
//        RequestDispatcher dispatcher2 = request.getRequestDispatcher("/WEB-INF/form.html");
        dispatcher2.forward(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
